import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import layout from '@/views/index.vue'
import pythonEditor from './pythonEditor.vue'
import login from './login.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    redirect: '/login',
    component: layout,
    children: [
      {
        path: '/pyEditor',
        name: 'pyEditor',
        component: pythonEditor,
        meta: {
          KeepAlive: true,
        },
      },
      {
        path:'/login',
        name:'login',
        component:login,
        meta: {
          KeepAlive: false
        }
      }
    ],
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

export default router
